package com.rainbow.util

import com.rainbow.entity.Result

/**
 *rainbow
 */
class ResultUtil {

    companion object {
        fun success(any: Any?): Result<Any> {
            val result = Result<Any>()
            result.code = 0
            result.msg = "成功"
            result.data = any

            return result
        }

        fun success(): Result<Any> {
            return success(null)
        }

        fun error(code: Int, msg: String): Result<Any> {
            val result = Result<Any>()
            result.code = code
            result.msg = msg
            return result
        }
    }
}